package javavis.jip2d.util;

import javavis.base.ImageType;
import javavis.base.JIPException;
import javavis.jip2d.base.JIPImage;
import javavis.jip2d.base.bitmaps.JIPBmpByte;
import javavis.jip2d.base.bitmaps.JIPBmpFloat;
import javavis.jip2d.functions.FConvolveImage;

/**
 * This class is used to give support to the FJunctions function
 * @author miguel
 *
 */
public final class Junctions {
	/* Discretizacion de los angulos */
	/* Segment counter */
	public final static int []SEG_COUNT  = {11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 12, 13, 
	     13, 13, 13, 14, 14, 14, 14, 13, 13, 14, 14, 14, 14, 14, 14, 15, 
	     15, 15, 15, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 15, 15, 
	     15,  8, 15, 15, 15, 16, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 
	     15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, 13, 14, 14, 14, 14, 
	     13, 13, 13, 13, 12, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11};
	                     
	     
	/* X coord */
	public final static int [][]X_COORD  = {
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 3, 4, 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 7, 7, 8, 9, 10, 0, 0, 0},
	 {0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 0, 0, 0},
	 {0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 0, 0, 0},
	 {0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0},
	 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0}};

	/* values */
	public final static float [][]VALUES  = {
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 0.990011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.500011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.490011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.490011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.010023f, 1.000022f, 1.000023f, 0.040001f, 0.440010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.010011f, 1.000023f, 1.000023f, 0.650015f, 0.350008f, 1.010023f, 1.000023f, 0.470011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 1.009999f, 1.000011f, 1.010023f, 0.210005f, 0.790018f, 1.000023f, 1.010023f, 1.000023f, 0.460011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 1.009999f, 0.999999f, 1.010012f, 0.260006f, 0.750017f, 1.000023f, 1.010023f, 1.000022f, 1.010023f, 0.440010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 0.999999f, 1.009999f, 0.580002f, 0.430010f, 1.010023f, 1.000023f, 1.010023f, 1.010023f, 1.010023f, 0.420010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 1.009999f, 1.009999f, 0.060000f, 0.950012f, 1.010023f, 1.010023f, 1.010023f, 1.010023f, 1.010023f, 0.400009f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 1.019999f, 0.659999f, 0.350000f, 1.010012f, 1.010023f, 1.020023f, 1.010023f, 1.010023f, 0.980022f, 0.030001f, 0.380009f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.019999f, 1.009999f, 0.340000f, 0.679999f, 1.010013f, 1.020023f, 1.020023f, 1.010023f, 1.020023f, 1.010023f, 0.350008f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.019999f, 1.019999f, 0.080000f, 0.939999f, 1.020013f, 1.020023f, 1.020023f, 1.020023f, 0.220005f, 0.790018f, 1.020023f, 0.320007f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.019999f, 0.869999f, 0.150000f, 1.019999f, 1.030014f, 1.020023f, 1.020023f, 0.570013f, 0.450010f, 1.020023f, 1.030024f, 0.280006f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.019999f, 0.689999f, 0.340000f, 1.029999f, 1.020014f, 1.030024f, 1.020023f, 0.010000f, 1.020023f, 1.030023f, 1.020023f, 0.250006f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.029999f, 0.520000f, 0.510000f, 1.029999f, 1.030014f, 1.030024f, 0.540012f, 0.490011f, 1.030024f, 1.040023f, 1.030024f, 0.200005f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.039999f, 0.380000f, 0.649999f, 1.039999f, 1.030015f, 1.040024f, 0.100002f, 0.930021f, 1.040024f, 1.030023f, 0.860020f, 0.180004f, 0.160004f, 0.000000f, 0.000000f},
	 {0.530000f, 1.039999f, 0.250000f, 0.789999f, 1.039999f, 1.040015f, 0.760017f, 0.280006f, 1.040024f, 1.040024f, 1.040023f, 0.220005f, 0.820019f, 0.110003f, 0.000000f, 0.000000f},
	 {0.530000f, 1.039999f, 0.150000f, 0.899999f, 1.039999f, 1.050016f, 0.430010f, 0.620014f, 1.040024f, 1.050024f, 0.710016f, 0.330008f, 1.050024f, 0.060001f, 0.000000f, 0.000000f},
	 {0.530000f, 1.049999f, 0.040000f, 1.009999f, 1.059999f, 1.050017f, 0.120003f, 0.930021f, 1.050024f, 1.050024f, 0.210004f, 0.840019f, 1.050024f, 0.010000f, 0.000000f, 0.000000f},
	 {0.530000f, 1.009999f, 0.050000f, 1.059999f, 1.059999f, 0.900014f, 0.150003f, 1.060024f, 1.060024f, 0.800018f, 0.260006f, 1.050024f, 1.010023f, 0.000000f, 0.000000f, 0.000000f},
	 {0.540000f, 0.929999f, 0.130000f, 1.069999f, 1.059999f, 0.660009f, 0.400009f, 1.070024f, 1.060024f, 0.390009f, 0.680016f, 1.060024f, 0.950022f, 0.000000f, 0.000000f, 0.000000f},
	 {0.540000f, 0.859999f, 0.210000f, 1.069999f, 1.069999f, 0.440004f, 0.640015f, 1.070024f, 1.070024f, 0.010000f, 1.060024f, 1.070024f, 0.660015f, 0.230005f, 0.000000f, 0.000000f},
	 {0.540000f, 0.799999f, 0.280000f, 1.079999f, 1.079999f, 0.230000f, 0.850019f, 1.080025f, 0.740017f, 0.340008f, 1.070024f, 1.080025f, 0.180004f, 0.650015f, 0.000000f, 0.000000f},
	 {0.550000f, 0.729999f, 0.350000f, 1.089999f, 1.089999f, 0.030000f, 1.050020f, 1.090025f, 0.420010f, 0.670015f, 1.080024f, 0.810019f, 0.280006f, 0.760017f, 0.000000f, 0.000000f},
	 {0.550000f, 0.679999f, 0.420000f, 1.089999f, 0.949999f, 0.150000f, 1.090021f, 1.100025f, 0.120003f, 0.970022f, 1.090024f, 0.400009f, 0.700016f, 0.690016f, 0.000000f, 0.000000f},
	 {0.560000f, 0.629999f, 0.470000f, 1.099999f, 0.789999f, 0.320000f, 1.100022f, 0.950022f, 0.150003f, 1.110025f, 1.100025f, 0.010000f, 1.090025f, 0.620014f, 0.000000f, 0.000000f},
	 {0.560000f, 0.589999f, 0.520000f, 1.119999f, 0.639999f, 0.470000f, 1.110023f, 0.700016f, 0.410009f, 1.120026f, 0.750017f, 0.360008f, 1.110025f, 0.540012f, 0.000000f, 0.000000f},
	 {0.570000f, 0.540000f, 0.579999f, 1.119999f, 0.500000f, 0.619999f, 1.130024f, 0.450010f, 0.670015f, 1.120026f, 0.410009f, 0.710016f, 1.120026f, 0.380009f, 0.080002f, 0.000000f},
	 {0.570000f, 0.500000f, 0.629999f, 1.139999f, 0.360000f, 0.769999f, 1.130025f, 0.230005f, 0.900021f, 1.140026f, 0.090002f, 1.040023f, 1.090025f, 0.040001f, 0.370008f, 0.000000f},
	 {0.580000f, 0.460000f, 0.679999f, 1.139999f, 0.240000f, 0.909999f, 1.140026f, 0.010000f, 1.130026f, 0.930021f, 0.220005f, 1.140026f, 0.710016f, 0.430010f, 0.280006f, 0.000000f},
	 {0.580000f, 0.430000f, 0.729999f, 1.149999f, 0.120000f, 1.040000f, 0.950022f, 0.200005f, 1.160027f, 0.640015f, 0.510012f, 1.160026f, 0.330008f, 0.820019f, 0.180004f, 0.000000f},
	 {0.590000f, 0.390000f, 0.769999f, 1.169999f, 1.170001f, 0.770018f, 0.390009f, 1.170027f, 0.380009f, 0.790018f, 1.150026f, 0.010000f, 1.170027f, 0.080002f, 0.000000f, 0.000000f},
	 {0.590000f, 0.360000f, 0.819999f, 1.069999f, 0.110000f, 1.180002f, 0.590014f, 0.590014f, 1.180027f, 0.120003f, 1.060024f, 0.830019f, 0.350008f, 1.150026f, 0.000000f, 0.000000f},
	 {0.600000f, 0.320000f, 0.869999f, 0.969999f, 0.230000f, 1.190003f, 0.420010f, 0.770018f, 1.060024f, 0.130003f, 1.200027f, 0.510011f, 0.680016f, 1.050024f, 0.000000f, 0.000000f},
	 {0.610000f, 0.290000f, 0.909999f, 0.879999f, 0.330000f, 1.210004f, 0.250006f, 0.950022f, 0.830019f, 0.380009f, 1.210028f, 0.200004f, 1.000023f, 0.790018f, 0.160004f, 0.000000f},
	 {0.620000f, 0.260000f, 0.959999f, 0.779999f, 0.440000f, 1.220006f, 0.080002f, 1.140026f, 0.610014f, 0.610014f, 1.130026f, 0.090002f, 1.220027f, 0.430010f, 0.410009f, 0.000000f},
	 {0.620000f, 0.240000f, 0.999999f, 0.699999f, 0.539999f, 1.160005f, 0.070002f, 1.240028f, 0.390009f, 0.840019f, 0.860020f, 0.380008f, 1.240028f, 0.080002f, 0.640015f, 0.000000f},
	 {0.630000f, 0.210000f, 1.039999f, 0.620000f, 0.639999f, 1.020003f, 0.230005f, 1.250029f, 0.180004f, 1.070024f, 0.590014f, 0.660015f, 1.000023f, 0.260006f, 0.600014f, 0.000000f},
	 {0.640000f, 0.180000f, 1.089999f, 0.530000f, 0.739999f, 0.890001f, 0.380009f, 1.240028f, 0.030001f, 1.260029f, 0.330008f, 0.940021f, 0.690016f, 0.580013f, 0.480011f, 0.000000f},
	 {0.650000f, 0.150000f, 1.139999f, 0.450000f, 0.829999f, 0.759999f, 0.530012f, 1.060024f, 0.230005f, 1.280029f, 0.080002f, 1.210027f, 0.370008f, 0.920021f, 0.340008f, 0.000000f},
	 {0.660000f, 0.120000f, 1.179999f, 0.380000f, 0.929999f, 0.619999f, 0.680013f, 0.880020f, 0.430010f, 1.130026f, 0.170004f, 1.310030f, 0.070002f, 1.240028f, 0.200005f, 0.000000f},
	 {0.670000f, 0.100000f, 1.219999f, 0.300000f, 1.029999f, 0.500000f, 0.820014f, 0.700016f, 0.630014f, 0.890020f, 0.430010f, 1.100025f, 0.230005f, 1.290030f, 0.030001f, 0.060001f},
	 {0.680000f, 0.070000f, 1.269999f, 0.230000f, 1.119999f, 0.370000f, 0.970016f, 0.530012f, 0.820019f, 0.670015f, 0.680016f, 0.810018f, 0.530012f, 0.970022f, 0.280006f, 0.000000f},
	 {0.690000f, 0.050000f, 1.319999f, 0.140000f, 1.219999f, 0.250000f, 1.120018f, 0.350008f, 1.020023f, 0.440010f, 0.930021f, 0.540012f, 0.820019f, 0.650015f, 0.460011f, 0.000000f},
	 {0.700000f, 0.020000f, 1.369999f, 0.070000f, 1.319999f, 0.120000f, 1.270020f, 0.170004f, 1.220028f, 0.220005f, 1.170027f, 0.270006f, 1.120025f, 0.320007f, 0.640015f, 0.000000f},
	 {0.710000f, 1.419999f, 1.409999f, 1.410021f, 1.420033f, 1.410032f, 1.420032f, 0.800018f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.700000f, 0.020000f, 1.369999f, 0.070000f, 1.319999f, 0.120000f, 1.270020f, 0.170004f, 1.220028f, 0.220005f, 1.170027f, 0.270006f, 1.120025f, 0.320007f, 0.640015f, 0.000000f},
	 {0.690000f, 0.050000f, 1.319999f, 0.140000f, 1.219999f, 0.250000f, 1.120018f, 0.350008f, 1.020023f, 0.440010f, 0.930021f, 0.540012f, 0.820019f, 0.650015f, 0.460011f, 0.000000f},
	 {0.680000f, 0.070000f, 1.269999f, 0.230000f, 1.119999f, 0.370000f, 0.970016f, 0.530012f, 0.820019f, 0.670015f, 0.680016f, 0.810018f, 0.530012f, 0.970022f, 0.280006f, 0.000000f},
	 {0.670000f, 0.100000f, 1.219999f, 0.300000f, 1.029999f, 0.500000f, 0.820014f, 0.700016f, 0.630014f, 0.890020f, 0.430010f, 1.100025f, 0.230005f, 1.290030f, 0.030001f, 0.060001f},
	 {0.660000f, 0.120000f, 1.179999f, 0.380000f, 0.929999f, 0.619999f, 0.680013f, 0.880020f, 0.430010f, 1.130026f, 0.170004f, 1.310030f, 0.070002f, 1.240028f, 0.200005f, 0.000000f},
	 {0.650000f, 0.150000f, 1.139999f, 0.450000f, 0.829999f, 0.759999f, 0.530012f, 1.060024f, 0.230005f, 1.280029f, 0.080002f, 1.210027f, 0.370008f, 0.920021f, 0.340008f, 0.000000f},
	 {0.640000f, 0.180000f, 1.089999f, 0.530000f, 0.739999f, 0.890001f, 0.380009f, 1.240028f, 0.030001f, 1.260029f, 0.330008f, 0.940021f, 0.690016f, 0.580013f, 0.480011f, 0.000000f},
	 {0.630000f, 0.210000f, 1.039999f, 0.620000f, 0.639999f, 1.020003f, 0.230005f, 1.250029f, 0.180004f, 1.070024f, 0.590014f, 0.660015f, 1.000023f, 0.260006f, 0.600014f, 0.000000f},
	 {0.620000f, 0.240000f, 0.999999f, 0.699999f, 0.539999f, 1.160005f, 0.070002f, 1.240028f, 0.390009f, 0.840019f, 0.860020f, 0.380008f, 1.240028f, 0.080002f, 0.640015f, 0.000000f},
	 {0.620000f, 0.260000f, 0.959999f, 0.779999f, 0.440000f, 1.220006f, 0.080002f, 1.140026f, 0.610014f, 0.610014f, 1.130026f, 0.090002f, 1.220027f, 0.430010f, 0.410009f, 0.000000f},
	 {0.610000f, 0.290000f, 0.909999f, 0.879999f, 0.330000f, 1.210004f, 0.250006f, 0.950022f, 0.830019f, 0.380009f, 1.210028f, 0.200004f, 1.000023f, 0.790018f, 0.160004f, 0.000000f},
	 {0.600000f, 0.320000f, 0.869999f, 0.969999f, 0.230000f, 1.190003f, 0.420010f, 0.770018f, 1.060024f, 0.130003f, 1.200027f, 0.510011f, 0.680016f, 1.050024f, 0.000000f, 0.000000f},
	 {0.590000f, 0.360000f, 0.819999f, 1.069999f, 0.110000f, 1.180002f, 0.590014f, 0.590014f, 1.180027f, 0.120003f, 1.060024f, 0.830019f, 0.350008f, 1.150026f, 0.000000f, 0.000000f},
	 {0.590000f, 0.390000f, 0.769999f, 1.169999f, 1.170001f, 0.770018f, 0.390009f, 1.170027f, 0.380009f, 0.790018f, 1.150026f, 0.010000f, 1.170027f, 0.080002f, 0.000000f, 0.000000f},
	 {0.580000f, 0.430000f, 0.729999f, 1.149999f, 0.120000f, 1.040000f, 0.950022f, 0.200005f, 1.160027f, 0.640015f, 0.510012f, 1.160026f, 0.330008f, 0.820019f, 0.180004f, 0.000000f},
	 {0.580000f, 0.460000f, 0.679999f, 1.139999f, 0.240000f, 0.909999f, 1.140026f, 0.010000f, 1.130026f, 0.930021f, 0.220005f, 1.140026f, 0.710016f, 0.430010f, 0.280006f, 0.000000f},
	 {0.570000f, 0.500000f, 0.629999f, 1.139999f, 0.360000f, 0.769999f, 1.130025f, 0.230005f, 0.900021f, 1.140026f, 0.090002f, 1.040023f, 1.090025f, 0.040001f, 0.370008f, 0.000000f},
	 {0.570000f, 0.540000f, 0.579999f, 1.119999f, 0.500000f, 0.619999f, 1.130024f, 0.450010f, 0.670015f, 1.120026f, 0.410009f, 0.710016f, 1.120026f, 0.380009f, 0.080002f, 0.000000f},
	 {0.560000f, 0.589999f, 0.520000f, 1.119999f, 0.639999f, 0.470000f, 1.110023f, 0.700016f, 0.410009f, 1.120026f, 0.750017f, 0.360008f, 1.110025f, 0.540012f, 0.000000f, 0.000000f},
	 {0.560000f, 0.629999f, 0.470000f, 1.099999f, 0.789999f, 0.320000f, 1.100022f, 0.950022f, 0.150003f, 1.110025f, 1.100025f, 0.010000f, 1.090025f, 0.620014f, 0.000000f, 0.000000f},
	 {0.550000f, 0.679999f, 0.420000f, 1.089999f, 0.949999f, 0.150000f, 1.090021f, 1.100025f, 0.120003f, 0.970022f, 1.090024f, 0.400009f, 0.700016f, 0.690016f, 0.000000f, 0.000000f},
	 {0.550000f, 0.729999f, 0.350000f, 1.089999f, 1.089999f, 0.030000f, 1.050020f, 1.090025f, 0.420010f, 0.670015f, 1.080024f, 0.810019f, 0.280006f, 0.760017f, 0.000000f, 0.000000f},
	 {0.540000f, 0.799999f, 0.280000f, 1.079999f, 1.079999f, 0.230000f, 0.850019f, 1.080025f, 0.740017f, 0.340008f, 1.070024f, 1.080025f, 0.180004f, 0.650015f, 0.000000f, 0.000000f},
	 {0.540000f, 0.859999f, 0.210000f, 1.069999f, 1.069999f, 0.440004f, 0.640015f, 1.070024f, 1.070024f, 0.010000f, 1.060024f, 1.070024f, 0.660015f, 0.230005f, 0.000000f, 0.000000f},
	 {0.540000f, 0.929999f, 0.130000f, 1.069999f, 1.059999f, 0.660009f, 0.400009f, 1.070024f, 1.060024f, 0.390009f, 0.680016f, 1.060024f, 0.950022f, 0.000000f, 0.000000f, 0.000000f},
	 {0.530000f, 1.009999f, 0.050000f, 1.059999f, 1.059999f, 0.900014f, 0.150003f, 1.060024f, 1.060024f, 0.800018f, 0.260006f, 1.050024f, 1.010023f, 0.000000f, 0.000000f, 0.000000f},
	 {0.530000f, 1.049999f, 0.040000f, 1.009999f, 1.059999f, 1.050017f, 0.120003f, 0.930021f, 1.050024f, 1.050024f, 0.210004f, 0.840019f, 1.050024f, 0.010000f, 0.000000f, 0.000000f},
	 {0.530000f, 1.039999f, 0.150000f, 0.899999f, 1.039999f, 1.050016f, 0.430010f, 0.620014f, 1.040024f, 1.050024f, 0.710016f, 0.330008f, 1.050024f, 0.060001f, 0.000000f, 0.000000f},
	 {0.530000f, 1.039999f, 0.250000f, 0.789999f, 1.039999f, 1.040015f, 0.760017f, 0.280006f, 1.040024f, 1.040024f, 1.040023f, 0.220005f, 0.820019f, 0.110003f, 0.000000f, 0.000000f},
	 {0.520000f, 1.039999f, 0.380000f, 0.649999f, 1.039999f, 1.030015f, 1.040024f, 0.100002f, 0.930021f, 1.040024f, 1.030023f, 0.860020f, 0.180004f, 0.160004f, 0.000000f, 0.000000f},
	 {0.520000f, 1.029999f, 0.520000f, 0.510000f, 1.029999f, 1.030014f, 1.030024f, 0.540012f, 0.490011f, 1.030024f, 1.040023f, 1.030024f, 0.200005f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.019999f, 0.689999f, 0.340000f, 1.029999f, 1.020014f, 1.030024f, 1.020023f, 0.010000f, 1.020023f, 1.030023f, 1.020023f, 0.250006f, 0.000000f, 0.000000f, 0.000000f},
	 {0.520000f, 1.019999f, 0.869999f, 0.150000f, 1.019999f, 1.030014f, 1.020023f, 1.020023f, 0.570013f, 0.450010f, 1.020023f, 1.030024f, 0.280006f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.019999f, 1.019999f, 0.080000f, 0.939999f, 1.020013f, 1.020023f, 1.020023f, 1.020023f, 0.220005f, 0.790018f, 1.020023f, 0.320007f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.019999f, 1.009999f, 0.340000f, 0.679999f, 1.010013f, 1.020023f, 1.020023f, 1.010023f, 1.020023f, 1.010023f, 0.350008f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 1.019999f, 0.659999f, 0.350000f, 1.010012f, 1.010023f, 1.020023f, 1.010023f, 1.010023f, 0.980022f, 0.030001f, 0.380009f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 1.009999f, 1.009999f, 0.060000f, 0.950012f, 1.010023f, 1.010023f, 1.010023f, 1.010023f, 1.010023f, 0.400009f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 1.009999f, 0.999999f, 1.009999f, 0.580002f, 0.430010f, 1.010023f, 1.000023f, 1.010023f, 1.010023f, 1.010023f, 0.420010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 1.009999f, 0.999999f, 1.010012f, 0.260006f, 0.750017f, 1.000023f, 1.010023f, 1.000022f, 1.010023f, 0.440010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 1.009999f, 1.000011f, 1.010023f, 0.210005f, 0.790018f, 1.000023f, 1.010023f, 1.000023f, 0.460011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.010011f, 1.000023f, 1.000023f, 0.650015f, 0.350008f, 1.010023f, 1.000023f, 0.470011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.010023f, 1.000022f, 1.000023f, 0.040001f, 0.440010f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.490011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 1.000011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.490011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},
	 {0.510000f, 0.999999f, 0.999999f, 0.999999f, 0.990011f, 1.000023f, 1.000023f, 1.000023f, 1.000022f, 1.000023f, 0.500011f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}};

	public static int discr_x (int radio, int angulo) {
		return ((angulo <= 90)?X_COORD[angulo][radio]:((angulo <= 180)?-X_COORD[180-angulo][radio]:((angulo <= 270)?-X_COORD[angulo-180][radio]:X_COORD[360-angulo][radio])));
	}

	public static int discr_y (int radio, int angulo) {
		return ((angulo <= 90)?-Y_COORD[angulo][radio]:((angulo <= 180)?-Y_COORD[180-angulo][radio]:((angulo <= 270)?Y_COORD[angulo-180][radio]:Y_COORD[360-angulo][radio])));
	}

	public static float discr_valor (int radio, int angulo) {
		return ((angulo <= 90)?VALUES[angulo][radio]:((angulo <= 180)?VALUES[180-angulo][radio]:((angulo <= 270)?VALUES[angulo-180][radio]:VALUES[360-angulo][radio])));
	}

	public static int discr_cont_seg(int angulo) { 
		return ((angulo <= 90)?SEG_COUNT[angulo]:((angulo <= 180)?SEG_COUNT[180-angulo]:((angulo <= 270)?SEG_COUNT[angulo-180]:SEG_COUNT[360-angulo])));
	}
	
	/**
	 * It calculates the magnitude and orientation applying a gaussian filter
	 * @param src
	 * @return
	 * @throws JIPException 
	 */
	public static JIPBmpFloat filterCalculation (JIPBmpByte src) throws JIPException {
	   float[] pixelsMag, pixelsOrien;
	   float[] pixelsTempx, pixelsTempy;
	   float[] mask;
	   JIPBmpFloat res;
	   JIPBmpFloat dfx, dfy, fx, fy, aux, tempx, tempy;
	   FConvolveImage fci;
	   
	   // Converts to float for better calculus, we do not convert to float (0..1) but keep the (0..255) values
	   JIPBmpFloat srcFloat = (JIPBmpFloat)JIPImage.newImage(src.getWidth(), src.getHeight(), ImageType.FLOAT);
	   srcFloat.setAllPixels(src.getAllPixels());

	   res = (JIPBmpFloat)JIPImage.newImage(2, src.getWidth(), src.getHeight(), ImageType.FLOAT);
	   fci = new FConvolveImage();
	   mask = new float[9];

	   fx = (JIPBmpFloat)JIPImage.newImage(9, 1, ImageType.FLOAT);
	   fy = (JIPBmpFloat)JIPImage.newImage(1, 9, ImageType.FLOAT);
	   // 1-d gaussian kernels
	   mask[0] = 0.0003677f;
	   mask[1] = 0.0077312f;
	   mask[2] = 0.066709f;
	   mask[3] = 0.2408f;
	   mask[4] = 0.36876f;
	   mask[5] = 0.2408f;
	   mask[6] = 0.066709f;
	   mask[7] = 0.0077312f;
	   mask[8] = 0.0003677f;
	   fx.setAllPixelsFloat(mask);
	   fy.setAllPixelsFloat(mask);
	   
	   dfx = (JIPBmpFloat)JIPImage.newImage(9, 1, ImageType.FLOAT);
	   dfy = (JIPBmpFloat)JIPImage.newImage(1, 9, ImageType.FLOAT);
	   // 1-d gaussian kernels (derivatives)
	   mask[0] =  0.0012862f;
	   mask[1] =  0.020078f;
	   mask[2] =  0.1145f;
	   mask[3] =  0.20546f;
	   mask[4] =  0.0f;
	   mask[5] = -0.20546f;
	   mask[6] = -0.1145f;
	   mask[7] = -0.020078f;
	   mask[8] = -0.0012862f;
	   dfx.setAllPixelsFloat(mask);
	   dfy.setAllPixelsFloat(mask);

	   fci.setParamValue("image", fx);
	   aux=(JIPBmpFloat) fci.processImg(srcFloat);
	   fci.setParamValue("image", dfx);
	   tempx=(JIPBmpFloat) fci.processImg(aux);
	   fci.setParamValue("image", fy);
	   aux=(JIPBmpFloat) fci.processImg(srcFloat);
	   fci.setParamValue("image", dfy);
	   tempy=(JIPBmpFloat) fci.processImg(aux);
	   
	   pixelsTempx=tempx.getAllPixelsFloat();
	   pixelsTempy=tempy.getAllPixelsFloat();
	   pixelsMag=new float[pixelsTempx.length];
	   pixelsOrien=new float[pixelsTempx.length];

	   // Calculates the magnitude and orientation of the gradient
	   for (int i=0; i<pixelsTempx.length; i++) {
		   pixelsMag[i]=(int)Math.sqrt(pixelsTempx[i]*pixelsTempx[i]+pixelsTempy[i]*pixelsTempy[i]);
		   pixelsOrien[i]=(float)Math.atan2(-pixelsTempy[i], pixelsTempx[i]);
	   }
	   res.setAllPixelsFloat(0,pixelsOrien);
	   res.setAllPixelsFloat(1,pixelsMag);
	   
	   return res;
	}
	
	public final static float[] binbnd = {
		0.0000000e+000f,
	  1.3295684e-004f,
	  2.6591368e-004f,
	  3.9887052e-004f,
	  5.3182737e-004f,
	  6.6478421e-004f,
	  7.9774105e-004f,
	  9.3069789e-004f,
	  1.0636547e-003f,
	  1.1966116e-003f,
	  1.3295684e-003f,
	  1.4625253e-003f,
	  1.5954821e-003f,
	  1.7284389e-003f,
	  1.8613958e-003f,
	  1.9943526e-003f,
	  2.1273095e-003f,
	  2.2602663e-003f,
	  2.3932231e-003f,
	  2.5261800e-003f,
	  2.6591368e-003f,
	  2.7920937e-003f,
	  2.9250505e-003f,
	  3.0580074e-003f,
	  3.1909642e-003f,
	  3.3239210e-003f,
	  3.4568779e-003f,
	  3.5898347e-003f,
	  3.7227916e-003f,
	  3.8557484e-003f,
	  3.9887052e-003f,
	  4.1216621e-003f,
	  4.2546189e-003f,
	  4.3875758e-003f,
	  4.5205326e-003f,
	  4.6534895e-003f,
	  4.7864463e-003f,
	  4.9194031e-003f,
	  5.0523600e-003f,
	  5.1853168e-003f,
	  5.3182737e-003f,
	  5.4512305e-003f,
	  5.5841873e-003f,
	  5.7171442e-003f,
	  5.8501010e-003f,
	  5.9830579e-003f,
	  6.1160147e-003f,
	  6.2489716e-003f,
	  6.3819284e-003f,
	  6.5148852e-003f,
	  6.6478421e-003f,
	  6.7807989e-003f,
	  6.9137558e-003f,
	  7.0467126e-003f,
	  7.1796694e-003f,
	  7.3126263e-003f,
	  7.4455831e-003f,
	  7.5785400e-003f,
	  7.7114968e-003f,
	  7.8444537e-003f,
	  7.9774105e-003f,
	  8.1103673e-003f,
	  8.2433242e-003f,
	  8.3762810e-003f,
	  8.5092379e-003f,
	  8.6421947e-003f,
	  8.7751515e-003f,
	  8.9081084e-003f,
	  9.0410652e-003f,
	  9.1740221e-003f,
	  9.3069789e-003f,
	  9.4399358e-003f,
	  9.5728926e-003f,
	  9.7058494e-003f,
	  9.8388063e-003f,
	  9.9717631e-003f,
	  1.0104720e-002f,
	  1.0237677e-002f,
	  1.0370634e-002f,
	  1.0503590e-002f,
	  1.0636547e-002f,
	  1.0769504e-002f,
	  1.0902461e-002f,
	  1.1035418e-002f,
	  1.1168375e-002f,
	  1.1301332e-002f,
	  1.1434288e-002f,
	  1.1567245e-002f,
	  1.1700202e-002f,
	  1.1833159e-002f,
	  1.1966116e-002f,
	  1.2099073e-002f,
	  1.2232029e-002f,
	  1.2364986e-002f,
	  1.2497943e-002f,
	  1.2630900e-002f,
	  1.2763857e-002f,
	  1.2896814e-002f,
	  1.3029770e-002f,
	  1.3162727e-002f,
	  1.3295684e-002f,
	  1.3428641e-002f,
	  1.3561598e-002f,
	  1.3694555e-002f,
	  1.3827512e-002f,
	  1.3960468e-002f,
	  1.4093425e-002f,
	  1.4226382e-002f,
	  1.4359339e-002f,
	  1.4492296e-002f,
	  1.4625253e-002f,
	  1.4758209e-002f,
	  1.4891166e-002f,
	  1.5024123e-002f,
	  1.5157080e-002f,
	  1.5290037e-002f,
	  1.5422994e-002f,
	  1.5555950e-002f,
	  1.5688907e-002f,
	  1.5821864e-002f,
	  1.5954821e-002f,
	  1.6087778e-002f,
	  1.6220735e-002f,
	  1.6353692e-002f,
	  1.6486648e-002f,
	  1.6619605e-002f,
	  1.6752562e-002f,
	  1.6885519e-002f,
	  1.7018476e-002f,
	  1.7151433e-002f,
	  1.7284389e-002f,
	  1.7417346e-002f,
	  1.7550303e-002f,
	  1.7683260e-002f,
	  1.7816217e-002f,
	  1.7949174e-002f,
	  1.8082130e-002f,
	  1.8215087e-002f,
	  1.8348044e-002f,
	  1.8481001e-002f,
	  1.8613958e-002f,
	  1.8746915e-002f,
	  1.8879872e-002f,
	  1.9012828e-002f,
	  1.9145785e-002f,
	  1.9278742e-002f,
	  1.9411699e-002f,
	  1.9544656e-002f,
	  1.9677613e-002f,
	  1.9810569e-002f,
	  1.9943526e-002f,
	  2.0076483e-002f,
	  2.0209440e-002f,
	  2.0342397e-002f,
	  2.0475354e-002f,
	  2.0608310e-002f,
	  2.0741267e-002f,
	  2.0874224e-002f,
	  2.1007181e-002f,
	  2.1140138e-002f,
	  2.1273095e-002f,
	  2.1406051e-002f,
	  2.1539008e-002f,
	  2.1671965e-002f,
	  2.1804922e-002f,
	  2.1937879e-002f,
	  2.2070836e-002f,
	  2.2203793e-002f,
	  2.2336749e-002f,
	  2.2469706e-002f,
	  2.2602663e-002f,
	  2.2735620e-002f,
	  2.2868577e-002f,
	  2.3001534e-002f,
	  2.3134490e-002f,
	  2.3267447e-002f,
	  2.3400404e-002f,
	  2.3533361e-002f,
	  2.3666318e-002f,
	  2.3799275e-002f,
	  2.3932231e-002f,
	  2.4065188e-002f,
	  2.4198145e-002f,
	  2.4331102e-002f,
	  2.4464059e-002f,
	  2.4597016e-002f,
	  2.4729973e-002f,
	  2.4862929e-002f,
	  2.4995886e-002f,
	  2.5128843e-002f,
	  2.5261800e-002f,
	  2.5394757e-002f,
	  2.6591679e-002f,
	  2.7788601e-002f,
	  2.8985523e-002f,
	  3.0182445e-002f,
	  3.1379368e-002f,
	  3.2576290e-002f,
	  3.3773212e-002f,
	  3.4970134e-002f,
	  3.6167056e-002f,
	  3.7363978e-002f,
	  3.8560901e-002f,
	  3.9757823e-002f,
	  4.0954745e-002f,
	  4.2151667e-002f,
	  4.3348589e-002f,
	  4.4545511e-002f,
	  4.5742434e-002f,
	  4.6939356e-002f,
	  4.8136278e-002f,
	  4.9333200e-002f,
	  5.0530122e-002f,
	  5.1727044e-002f,
	  5.2923967e-002f,
	  5.4120889e-002f,
	  5.5317811e-002f,
	  5.6514733e-002f,
	  5.7711655e-002f,
	  5.8908577e-002f,
	  6.0105500e-002f,
	  6.1302422e-002f,
	  6.2499344e-002f,
	  6.3696266e-002f,
	  6.4893188e-002f,
	  6.6090110e-002f,
	  6.7287033e-002f,
	  6.8483955e-002f,
	  6.9680877e-002f,
	  7.0877799e-002f,
	  7.2074721e-002f,
	  7.3271643e-002f,
	  7.4468566e-002f,
	  7.5665488e-002f,
	  7.6862410e-002f,
	  7.8059332e-002f,
	  7.9256254e-002f,
	  8.0453176e-002f,
	  8.1650099e-002f,
	  8.2847021e-002f,
	  8.4043943e-002f,
	  8.5240865e-002f,
	  8.6437787e-002f,
	  8.7634709e-002f,
	  8.8831632e-002f,
	  9.0028554e-002f,
	  9.1225476e-002f,
	  9.2422398e-002f,
	  9.3619320e-002f,
	  9.4816242e-002f,
	  9.6013165e-002f,
	  9.7210087e-002f,
	  9.8407009e-002f,
	  9.9603931e-002f,
	  1.0080085e-001f,
	  1.0199778e-001f};		   

	public final static float[]hon={
		  1.4600000e+002f,
		  3.6000000e+002f,
		  5.8100000e+002f,
		  7.7400000e+002f,
		  1.1070000e+003f,
		  1.1980000e+003f,
		  1.4080000e+003f,
		  1.6800000e+003f,
		  1.9570000e+003f,
		  2.1370000e+003f,
		  2.3110000e+003f,
		  2.4320000e+003f,
		  2.5080000e+003f,
		  2.7800000e+003f,
		  2.9730000e+003f,
		  3.0920000e+003f,
		  3.2240000e+003f,
		  3.2660000e+003f,
		  3.4380000e+003f,
		  3.6520000e+003f,
		  3.7560000e+003f,
		  3.9250000e+003f,
		  3.9900000e+003f,
		  4.1920000e+003f,
		  4.3450000e+003f,
		  4.2780000e+003f,
		  4.4760000e+003f,
		  4.7140000e+003f,
		  4.7510000e+003f,
		  5.0120000e+003f,
		  4.9970000e+003f,
		  5.0800000e+003f,
		  5.2190000e+003f,
		  5.4010000e+003f,
		  5.3780000e+003f,
		  5.4280000e+003f,
		  5.6010000e+003f,
		  5.6220000e+003f,
		  5.7230000e+003f,
		  5.8510000e+003f,
		  5.9250000e+003f,
		  6.0150000e+003f,
		  6.0420000e+003f,
		  6.1220000e+003f,
		  6.1910000e+003f,
		  6.2920000e+003f,
		  6.3810000e+003f,
		  6.2560000e+003f,
		  6.4140000e+003f,
		  6.4270000e+003f,
		  6.4280000e+003f,
		  6.4670000e+003f,
		  6.4950000e+003f,
		  6.6420000e+003f,
		  6.7440000e+003f,
		  6.6870000e+003f,
		  6.7340000e+003f,
		  6.8880000e+003f,
		  6.6950000e+003f,
		  6.8700000e+003f,
		  6.9720000e+003f,
		  6.9350000e+003f,
		  6.8760000e+003f,
		  6.9020000e+003f,
		  7.0810000e+003f,
		  6.9530000e+003f,
		  6.9660000e+003f,
		  7.0150000e+003f,
		  7.1810000e+003f,
		  7.2110000e+003f,
		  7.1730000e+003f,
		  7.2710000e+003f,
		  7.2690000e+003f,
		  7.2740000e+003f,
		  7.3150000e+003f,
		  7.2730000e+003f,
		  7.3530000e+003f,
		  7.2200000e+003f,
		  7.2220000e+003f,
		  7.3320000e+003f,
		  7.3340000e+003f,
		  7.3590000e+003f,
		  7.3300000e+003f,
		  7.4120000e+003f,
		  7.3760000e+003f,
		  7.2020000e+003f,
		  7.2710000e+003f,
		  7.3950000e+003f,
		  7.3800000e+003f,
		  7.4710000e+003f,
		  7.1500000e+003f,
		  7.2410000e+003f,
		  7.3990000e+003f,
		  7.2480000e+003f,
		  7.3440000e+003f,
		  7.2060000e+003f,
		  7.2240000e+003f,
		  7.1990000e+003f,
		  7.2720000e+003f,
		  7.2050000e+003f,
		  7.1830000e+003f,
		  7.3530000e+003f,
		  7.3430000e+003f,
		  7.2400000e+003f,
		  7.2130000e+003f,
		  7.2550000e+003f,
		  7.0690000e+003f,
		  7.1980000e+003f,
		  7.0530000e+003f,
		  7.1750000e+003f,
		  7.1230000e+003f,
		  7.0890000e+003f,
		  7.0830000e+003f,
		  6.8780000e+003f,
		  7.0710000e+003f,
		  7.0100000e+003f,
		  6.8880000e+003f,
		  7.0100000e+003f,
		  6.9990000e+003f,
		  6.8020000e+003f,
		  6.9900000e+003f,
		  6.7210000e+003f,
		  6.9300000e+003f,
		  6.8670000e+003f,
		  6.8060000e+003f,
		  6.7210000e+003f,
		  6.7290000e+003f,
		  6.8810000e+003f,
		  6.6770000e+003f,
		  6.7450000e+003f,
		  6.5400000e+003f,
		  6.5830000e+003f,
		  6.5900000e+003f,
		  6.5750000e+003f,
		  6.6330000e+003f,
		  6.6390000e+003f,
		  6.5600000e+003f,
		  6.4230000e+003f,
		  6.5010000e+003f,
		  6.5190000e+003f,
		  6.4610000e+003f,
		  6.3930000e+003f,
		  6.2990000e+003f,
		  6.3890000e+003f,
		  6.3290000e+003f,
		  6.4090000e+003f,
		  6.1810000e+003f,
		  6.3610000e+003f,
		  6.2940000e+003f,
		  6.2160000e+003f,
		  6.2170000e+003f,
		  6.1670000e+003f,
		  6.0270000e+003f,
		  6.1690000e+003f,
		  6.0510000e+003f,
		  6.1000000e+003f,
		  5.9470000e+003f,
		  5.9700000e+003f,
		  5.8630000e+003f,
		  5.8710000e+003f,
		  6.0000000e+003f,
		  5.8550000e+003f,
		  5.9080000e+003f,
		  5.8610000e+003f,
		  5.8330000e+003f,
		  5.8600000e+003f,
		  5.8310000e+003f,
		  5.6350000e+003f,
		  5.8610000e+003f,
		  5.5610000e+003f,
		  5.6880000e+003f,
		  5.6060000e+003f,
		  5.5750000e+003f,
		  5.6230000e+003f,
		  5.6050000e+003f,
		  5.4320000e+003f,
		  5.4950000e+003f,
		  5.4070000e+003f,
		  5.4730000e+003f,
		  5.4040000e+003f,
		  5.4080000e+003f,
		  5.4360000e+003f,
		  5.4460000e+003f,
		  5.2830000e+003f,
		  5.2480000e+003f,
		  5.3840000e+003f,
		  5.3660000e+003f,
		  5.2060000e+003f,
		  5.1920000e+003f,
		  5.1790000e+003f,
		  5.0840000e+003f,
		  4.5491000e+004f,
		  4.3414000e+004f,
		  4.1540000e+004f,
		  4.0276000e+004f,
		  3.8019000e+004f,
		  3.6719000e+004f,
		  3.4565000e+004f,
		  3.3689000e+004f,
		  3.2277000e+004f,
		  3.1198000e+004f,
		  2.9504000e+004f,
		  2.8302000e+004f,
		  2.7026000e+004f,
		  2.6353000e+004f,
		  2.5235000e+004f,
		  2.3789000e+004f,
		  2.3301000e+004f,
		  2.2046000e+004f,
		  2.1356000e+004f,
		  2.0442000e+004f,
		  1.9569000e+004f,
		  1.8555000e+004f,
		  1.8283000e+004f,
		  1.7461000e+004f,
		  1.7101000e+004f,
		  1.6030000e+004f,
		  1.5818000e+004f,
		  1.5124000e+004f,
		  1.4551000e+004f,
		  1.4295000e+004f,
		  1.3449000e+004f,
		  1.3028000e+004f,
		  1.2356000e+004f,
		  1.2218000e+004f,
		  1.1773000e+004f,
		  1.1306000e+004f,
		  1.0763000e+004f,
		  1.0446000e+004f,
		  1.0154000e+004f,
		  9.7050000e+003f,
		  9.3620000e+003f,
		  8.9870000e+003f,
		  8.7580000e+003f,
		  8.5770000e+003f,
		  8.1340000e+003f,
		  7.9800000e+003f,
		  7.7670000e+003f,
		  7.4750000e+003f,
		  7.2650000e+003f,
		  6.9880000e+003f,
		  6.9360000e+003f,
		  6.7690000e+003f,
		  6.6780000e+003f,
		  6.3040000e+003f,
		  6.1980000e+003f,
		  5.7930000e+003f,
		  5.6840000e+003f,
		  5.4840000e+003f,
		  5.5670000e+003f,
		  5.4700000e+003f,
		  5.2370000e+003f,
		  4.9500000e+003f,
		  4.8460000e+003f,
		  4.6570000e+003f,
		  1.5085200e+005f };
	
	public final static float hoff[] = {
		  3.3048000e+004f,
		  8.1861000e+004f,
		  1.2759100e+005f,
		  1.6920200e+005f,
		  2.0661900e+005f,
		  2.4075300e+005f,
		  2.7022100e+005f,
		  2.9753100e+005f,
		  3.1832600e+005f,
		  3.3957000e+005f,
		  3.5538500e+005f,
		  3.6715400e+005f,
		  3.7870600e+005f,
		  3.8554300e+005f,
		  3.9099800e+005f,
		  3.9278900e+005f,
		  3.9452900e+005f,
		  3.9338100e+005f,
		  3.9178800e+005f,
		  3.8899300e+005f,
		  3.8665800e+005f,
		  3.8317100e+005f,
		  3.7839700e+005f,
		  3.7314500e+005f,
		  3.6862800e+005f,
		  3.6354000e+005f,
		  3.5890800e+005f,
		  3.5388800e+005f,
		  3.4876000e+005f,
		  3.4351900e+005f,
		  3.3905500e+005f,
		  3.3598300e+005f,
		  3.3054700e+005f,
		  3.2564900e+005f,
		  3.2226600e+005f,
		  3.1939100e+005f,
		  3.1265500e+005f,
		  3.1035900e+005f,
		  3.0596800e+005f,
		  3.0246700e+005f,
		  2.9794300e+005f,
		  2.9429900e+005f,
		  2.9011600e+005f,
		  2.8658800e+005f,
		  2.8279100e+005f,
		  2.8014100e+005f,
		  2.7517500e+005f,
		  2.7304200e+005f,
		  2.6700700e+005f,
		  2.6531300e+005f,
		  2.6050300e+005f,
		  2.5767500e+005f,
		  2.5268400e+005f,
		  2.5055200e+005f,
		  2.4605300e+005f,
		  2.4287900e+005f,
		  2.3904400e+005f,
		  2.3545600e+005f,
		  2.3119600e+005f,
		  2.2795000e+005f,
		  2.2483300e+005f,
		  2.2214300e+005f,
		  2.1831700e+005f,
		  2.1556300e+005f,
		  2.1174900e+005f,
		  2.0861100e+005f,
		  2.0433400e+005f,
		  2.0144700e+005f,
		  1.9832300e+005f,
		  1.9524400e+005f,
		  1.9279900e+005f,
		  1.8919200e+005f,
		  1.8654100e+005f,
		  1.8384100e+005f,
		  1.8052500e+005f,
		  1.7847300e+005f,
		  1.7423300e+005f,
		  1.7211700e+005f,
		  1.6864000e+005f,
		  1.6645800e+005f,
		  1.6522400e+005f,
		  1.6113900e+005f,
		  1.5857200e+005f,
		  1.5583300e+005f,
		  1.5350100e+005f,
		  1.5101800e+005f,
		  1.4939100e+005f,
		  1.4674400e+005f,
		  1.4432400e+005f,
		  1.4188800e+005f,
		  1.3977300e+005f,
		  1.3757600e+005f,
		  1.3509300e+005f,
		  1.3194300e+005f,
		  1.3053100e+005f,
		  1.2812800e+005f,
		  1.2708400e+005f,
		  1.2463500e+005f,
		  1.2288200e+005f,
		  1.2096300e+005f,
		  1.1888900e+005f,
		  1.1762400e+005f,
		  1.1557700e+005f,
		  1.1244600e+005f,
		  1.1148300e+005f,
		  1.0998800e+005f,
		  1.0839100e+005f,
		  1.0701500e+005f,
		  1.0485200e+005f,
		  1.0316100e+005f,
		  1.0127500e+005f,
		  9.9864000e+004f,
		  9.8522000e+004f,
		  9.7707000e+004f,
		  9.5147000e+004f,
		  9.3829000e+004f,
		  9.1881000e+004f,
		  9.1440000e+004f,
		  8.9633000e+004f,
		  8.8307000e+004f,
		  8.6306000e+004f,
		  8.5727000e+004f,
		  8.4104000e+004f,
		  8.2348000e+004f,
		  8.1365000e+004f,
		  8.0105000e+004f,
		  7.8839000e+004f,
		  7.7616000e+004f,
		  7.6827000e+004f,
		  7.5725000e+004f,
		  7.4439000e+004f,
		  7.3220000e+004f,
		  7.2334000e+004f,
		  7.1493000e+004f,
		  7.0069000e+004f,
		  6.9361000e+004f,
		  6.7933000e+004f,
		  6.7113000e+004f,
		  6.6041000e+004f,
		  6.4865000e+004f,
		  6.4235000e+004f,
		  6.3136000e+004f,
		  6.1960000e+004f,
		  6.1595000e+004f,
		  6.0457000e+004f,
		  5.9365000e+004f,
		  5.8734000e+004f,
		  5.8077000e+004f,
		  5.7149000e+004f,
		  5.5861000e+004f,
		  5.5925000e+004f,
		  5.4228000e+004f,
		  5.3175000e+004f,
		  5.3139000e+004f,
		  5.2077000e+004f,
		  5.1891000e+004f,
		  5.0778000e+004f,
		  5.0258000e+004f,
		  4.9201000e+004f,
		  4.8935000e+004f,
		  4.7759000e+004f,
		  4.7796000e+004f,
		  4.6828000e+004f,
		  4.6119000e+004f,
		  4.5720000e+004f,
		  4.4353000e+004f,
		  4.3846000e+004f,
		  4.3680000e+004f,
		  4.3424000e+004f,
		  4.2794000e+004f,
		  4.1609000e+004f,
		  4.1276000e+004f,
		  4.1261000e+004f,
		  4.0334000e+004f,
		  3.9667000e+004f,
		  3.9304000e+004f,
		  3.8614000e+004f,
		  3.8235000e+004f,
		  3.7705000e+004f,
		  3.7022000e+004f,
		  3.6724000e+004f,
		  3.6022000e+004f,
		  3.5947000e+004f,
		  3.5409000e+004f,
		  3.4745000e+004f,
		  3.4213000e+004f,
		  3.3838000e+004f,
		  3.3658000e+004f,
		  3.2921000e+004f,
		  3.2517000e+004f,
		  3.2232000e+004f,
		  2.7167600e+005f,
		  2.4464100e+005f,
		  2.1865200e+005f,
		  1.9813700e+005f,
		  1.7816200e+005f,
		  1.6172300e+005f,
		  1.4791500e+005f,
		  1.3516400e+005f,
		  1.2430300e+005f,
		  1.1460600e+005f,
		  1.0526900e+005f,
		  9.7702000e+004f,
		  8.9932000e+004f,
		  8.3881000e+004f,
		  7.7455000e+004f,
		  7.2462000e+004f,
		  6.7517000e+004f,
		  6.3686000e+004f,
		  5.9360000e+004f,
		  5.5786000e+004f,
		  5.2494000e+004f,
		  4.9380000e+004f,
		  4.6512000e+004f,
		  4.4167000e+004f,
		  4.1572000e+004f,
		  3.9472000e+004f,
		  3.6964000e+004f,
		  3.5134000e+004f,
		  3.3118000e+004f,
		  3.1640000e+004f,
		  2.9926000e+004f,
		  2.8369000e+004f,
		  2.6968000e+004f,
		  2.5513000e+004f,
		  2.4424000e+004f,
		  2.3191000e+004f,
		  2.2126000e+004f,
		  2.1381000e+004f,
		  2.0620000e+004f,
		  1.9432000e+004f,
		  1.8563000e+004f,
		  1.7785000e+004f,
		  1.7040000e+004f,
		  1.5865000e+004f,
		  1.5396000e+004f,
		  1.4792000e+004f,
		  1.4153000e+004f,
		  1.3517000e+004f,
		  1.2991000e+004f,
		  1.2404000e+004f,
		  1.1954000e+004f,
		  1.1399000e+004f,
		  1.0786000e+004f,
		  1.0312000e+004f,
		  9.9000000e+003f,
		  9.4610000e+003f,
		  9.3250000e+003f,
		  8.7860000e+003f,
		  8.4010000e+003f,
		  7.9080000e+003f,
		  7.9310000e+003f,
		  7.4220000e+003f,
		  7.0400000e+003f,
		  6.9860000e+003f,
		  1.6070900e+005f
	};
	
	public static int which_bin (float value, float []binbnd) {
	  int i;
	  for (i=1; ((i<binbnd.length) && (binbnd[i] < value)); i++);
	  return (i-1);
	}
	
	public static boolean consistent (float x, float y, float del_ang) {
	  return ( (x-y)%Math.PI < del_ang || Math.PI-((x-y)%Math.PI) < del_ang);
	}
	
	public static boolean comparacion (int i, float []histo) {
	   return (histo[i] >= histo[(((i-10)<0)?i+350:i-10)] &&
			   histo[i] >= histo[(((i-9)<0)?i+351:i-9)] &&
			   histo[i] >= histo[(((i-8)<0)?i+252:i-8)] &&
			   histo[i] >= histo[(((i-7)<0)?i+253:i-7)] &&
			   histo[i] >= histo[(((i-6)<0)?i+254:i-6)] &&
			   histo[i] >= histo[(((i-5)<0)?i+355:i-5)] &&
			   histo[i] >= histo[(((i-4)<0)?i+356:i-4)] &&
			   histo[i] >= histo[(((i-3)<0)?i+257:i-3)] &&
			   histo[i] >= histo[(((i-2)<0)?i+258:i-2)] &&
			   histo[i] >= histo[(((i-1)<0)?i+259:i-1)] &&
			   histo[i] > histo[(i+1)%360] &&
			   histo[i] > histo[(i+2)%360] &&
			   histo[i] > histo[(i+3)%360] &&
			   histo[i] > histo[(i+4)%360] &&
			   histo[i] > histo[(i+5)%360] &&
			   histo[i] > histo[(i+6)%360] &&
			   histo[i] > histo[(i+7)%360] &&
			   histo[i] > histo[(i+8)%360] &&
			   histo[i] > histo[(i+9)%360] &&
			   histo[i] > histo[(i+10)%360]);
	}
}
